import {useState} from 'react'
import {createContext} from './createContext'


interface StoreProviderState {
  count1: number;
  count2: number;
  setCount1: (count: number) => void;
  setCount2: (count: number) => void;
}

interface StoreProviderProps {
  children: React.ReactNode;
}

export const Context = createContext<StoreProviderState | null>(null);

export default function StoreProvider({ children }: StoreProviderProps) {
  const [count1, setCount1] = useState(0);
  const [count2, setCount2] = useState(0);

  const value = {
    count1,
    count2,
    setCount1,
    setCount2,
  };

  console.log('xxxx hello');

  return <Context.Provider value={value}>{children}</Context.Provider>;
}
